<?php

namespace app\common;

use org\DingDingRobot;
use think\console\Command;

class RootCommand extends Command
{
    /**
     * 参数配置
     * @var string[]
     */
    protected $config = [
        'token' => '680f946e98c99076eaa7d50094c18ef462d60f2e83dcd187cab1bae73acf26f3',
        'secret' => 'SECb782da86d735f4721f4f8334de4225962d043d97bd0438acdd7f3a2365c15467',
    ];

    /**
     * 发送消息通知
     * @param string $message
     */
    protected function sendTxtNotify(string $message)
    {
        DingDingRobot::getInstance($this->config)->pushText($message);
    }

    /**
     * 当天是否有做过任务
     * @param array $hashData
     * @return bool
     */
    protected function hashToday(array $hashData)
    {
        return $hashData['date'] == date('Y-m-d');
    }
}